import 'dart:convert';
import 'package:crypto/crypto.dart';
import 'package:flutter_yn_goods/user/app_user_manager.dart';

class SharedKey {
  static String get deviceId => 'device_id';

  static String get account => 'account'.toMD5;

  // static String get password => 'password'.toMD5;

  static String get token => 'app_user_token'.toMD5;

  static String get userInfo => 'app_user_Info'.toMD5;

  static String get firstLaunch => "first_launch".toMD5;


  static String get langCode => "langCode".toMD5;
  static String get countryCode => "countryCode".toMD5;
}

extension StringMd5Extension on String {
  String get addUid => this + AppUserManager().uid.toString();

  // String get addUid => this + '123'.toString();

  String get toMD5 => md5.convert(utf8.encode(this)).toString();

  // String get toBase64Encode => base64Encode(utf8.encode(this));
  //
  // String get toBase64Decode => const Utf8Decoder()
  //     .convert(base64Decode(this)); //String.fromCharCodes(base64Decode(this));
}
